package homework;

import com.sun.org.apache.xerces.internal.xs.ShortList;

public class Demo1 {
    public static void main(String[] args) {
        byte a = 1;//-128到127
        System.out.println(a);

        short b = 2;//-32768到+32767
        System.out.println(b);

        int c = 3;//-21亿多到+21亿多
        System.out.println(c);

        long d = 4L;
        System.out.println(d);

        float e = 225.0234F;
        System.out.println(e);

        double f = 6.12345;
        System.out.println(f);

        char g = 65535;char h = 'p';//char采用unicode字符编码格式。单字符类型，‘’中只能有一个字符，或者不加‘’的0到65535之间的数字，一个数字对应一个字符
        System.out.println(g);
        System.out.println(h);

        boolean i = true;//true/false
        System.out.println(i);

        short j = a;
        System.out.println(j);

        int k = a;
        System.out.println(k);

        long l = a;
        System.out.println(l);

        float m = a;
        System.out.println(m);

        double n = a;
        System.out.println(n);
        //小范围转大范围属于自动隐式转换 从小到大的顺序为byte short int long float double

        short o = (short) c;
        System.out.println(o);

        long p = (long) f;
        System.out.println(p);
        //大范围转小范围属于强制类型转换 要防止溢出

        System.out.println("int的最大值："+Integer.MAX_VALUE);
        System.out.println("int的最小值："+Integer.MIN_VALUE);
    }
}
